package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DishFlavorMapper {
    //插入菜品口味，使用批量插入
    void saveBatch(@Param("dishFlavorList") List<DishFlavor> dishFlavorList);

    //根据id查询菜品口味
    @Select("SELECT * FROM dish_flavor WHERE dish_id=#{dishId}")
    List<DishFlavor> findByDishId(Long id);
    //根据菜品id删除菜品口味
    @Delete("DELETE FROM dish_flavor WHERE dish_id=#{dishId}")
    void deleteByDishId(Long id);
}
